package com.onlineMIS.ORM.entity.headQ.finance;

import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;

import org.apache.commons.beanutils.BeanUtils;

import com.onlineMIS.common.DateUtils;


public class FinanceCategoryVO extends FinanceCategory implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -8852583637495149815L;
	public FinanceCategoryVO() {
		
	}
	
	public FinanceCategoryVO(FinanceCategory f, Double accuAmt,Double advancePay)  {		
		if (accuAmt == null) {
			accuAmt = new Double(0);
		}		
		this.setCreateBy(f.getCreateBy());
		if (f.getCreateTime() !=null) {
			this.setCreateDate(DateUtils.parseDateToStr(f.getCreateTime()));
		}
		this.setId(f.getId());
		this.setItemName(f.getItemName());
		this.setStatus(f.getStatus());
		this.setInitialAmt(f.getInitialAmt());
		this.setType(f.getType());
		this.setIsTransferAccounts(f.getIsTransferAccounts());
		this.setSort(f.getSort());
		this.setBelongTos(f.getBelongToMap().get(f.getBelongTo()));
		this.setBelongTo2(f.getBelongTo2());
		this.setComment(f.getComment());
		//预存金账目 = 期初账目 + （客户充值 - 客户消费）
		this.setAcumulateAmt(f.getInitialAmt() + accuAmt + advancePay);
	}

	private String statusS;      //状态名称
	private String transferAccounts; //是否支持转账
	private int sort;
	private String belongTos;
	private int belongTo2;
	private double acumulateAmt; //累计账户
	private String createDate;
	
		
	public String getStatusS() {
		switch (getStatus()) {
		case FinanceCategory.NORMAL_STATUS:
			return "正常";
		case FinanceCategory.ABNORMAL_STATUS:
			return "停用";
		default:
			return "未知状态";
		}
	}
	
	public String getTransferAccounts() {
		switch (getIsTransferAccounts()) {
		case FinanceCategory.SUPPORT_TRANSFER_ACCOUNTS:
			return "是";
		case FinanceCategory.NO_SUPPORT_TRANSFER_ACCOUNTS:
			return "否";
		default:
			return "未知";
		}
	}

	public void setTransferAccounts(String transferAccounts) {
		this.transferAccounts = transferAccounts;
	}

	public void setStatusS(String statusS) {
		this.statusS = statusS;
	}
	public double getAcumulateAmt() {
		return acumulateAmt;
	}
	public void setAcumulateAmt(double acumulateAmt) {
		this.acumulateAmt = acumulateAmt;
	}

	public String getCreateDate() {
		return createDate;
	}

	public void setCreateDate(String createDate) {
		this.createDate = createDate;
	}

	public int getSort() {
		return sort;
	}

	public void setSort(int sort) {
		this.sort = sort;
	}

	public String getBelongTos() {
		return belongTos;
	}

	public void setBelongTos(String belongTos) {
		this.belongTos = belongTos;
	}

	public int getBelongTo2() {
		return belongTo2;
	}

	public void setBelongTo2(int belongTo2) {
		this.belongTo2 = belongTo2;
	}


}
